import { getApi, postApi } from "@/utils/http";

/**
 * @description: 获取房源列表
 * @param {any} data
 * @return {*}
 */
export async function houseSearchList(data: any) {
  return await getApi('/client/houseSearch/list', data);
}

/**
 * @description: 我的收藏房源
 * @param {any} data
 * @return {*}
 */
export async function houseCollectList(data: any) {
  return await getApi('/client/houseSearch/queryClientMyHouseSales', data);
}

/**
 * @description: 通过房源id查询房源相关信息
 * @param {any} data
 * @return {*}
 */
export async function getHouseInfoById(data: any) {
  return await getApi('/client/houseSearch/queryByHouseSaleId', data);
}

/**
 * @description: 通过楼盘id查询小区相关信息
 * @param {any} data
 * @return {*}
 */
export async function getHouseAreaInfoByCid(data: any) {
  return await getApi('/client/houseSearch/queryByCommunityId', data);
}

/**
 * @description: 获取随机三个金牌经纪人
 * @param {any} data
 * @return {*}
 */
export async function getRandomBroker(data: any) {
  return await getApi('/client/houseSearch/disRandomList', data);
}

/**
 * @description: 获取主推荐位的经纪人信息
 * @param {string} id
 * @return {*}
 */
export async function getMainBrokerInfo(id: string) {
  return await postApi(`/client/agent/queryAgentMsg/${id}`);
}

/**
 * @description: 通过房源id查询房源推荐列表
 * @param {any} data
 * @return {*}
 */
export async function getMoreHouseList(data: any) {
  return await getApi('/client/houseSearch/queryMoreByHouseSaleId', data);
}

/**
 * @description: 通过房源id获取房源图片
 * @param {any} data
 * @return {*}
 */
export async function getHouseFileById(data: any) {
  return await getApi('/client/houseSearch/queryFileByHouseSaleId', data);
}

/**
 * @description: 通过小区id获取小区图片
 * @param {any} data
 * @return {*}
 */
export async function getCommunityFileByCId(data: any) {
  return await getApi('/client/houseSearch/queryFileByCommunityId', data);
}

/**
 * @description: 根据关键词搜索聚合
 * @param {any} data
 * @return {*}
 */
export async function getSearchList(data: any) {
  return await getApi('/client/houseSearch/queryClientASCBySearchText', data);
}

/**
 * @description: 查询是否收藏
 * @param {any} data
 * @return {*}
 */
export async function getIsCollect(id: any) {
  return await getApi('/client/houseSearch/queryIfCollection/'+id, null);
}

/**
 * @description: 收藏房源
 * @param {any} data
 * @return {*}
 */
export async function houseCollect(id: any) {
  return await getApi('/client/houseSearch/saveOrDeleteMyCollection/'+id, null);
}

